import serve from '@/utils/serve'
import request from '@/utils/request'
// 获取盘点单
export function getCheckpage(data) {
  return serve({
    url: '/check/pageDetail',
    method: 'get',
    params: data
  })
}
// 获取盘点单2
export function getCheckpage2(data) {
  return serve({
    url: '/checkList/pageDetail',
    method: 'get',
    params: data
  })
}
// 获取可用仓库接口
export function getuseWarehouse() {
  return request({
    url: '/warehouse/list?status=1'
  })
}
// 获取子仓库
export function getArealist(warehouseId) {
  return request({
    url: '/area/list',
    params: { warehouseId }
  })
}
// 获取新的盘点单号
export function getPD() {
  return request({
    url: '/codeFactory/next/PD'
  })
}
// 获取所有货主owner/list
export function getOwner() {
  return request({
    url: '/owner/list'
  })
}

// 新增盘点单
export function addPD(data) {
  return serve({
    url: '/check',
    method: 'post',
    data
  })
}
// 根据盘点单号查询数据
export function checkPD(id) {
  return request({
    url: `/check/detail`
  })
}

// 取消新建单PD
export function cancelPD(id) {
  return serve({
    url: '/check/cancel',
    method: 'put',
    data: { id }
  })
}
// 查看详情获取列表时间
export function getdetail(id) {
  return serve({
    url: `/check/detail/${id}`,
    params: { 0: id }
  })
}
